package com.mekong.sys.service.impl;

import com.mekong.sys.domain.CGoodsManagement;

import com.mekong.sys.mapper.CGoodsManagementMapper;
import com.mekong.sys.service.ICGoodsManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品管理Service业务层处理
 *
 * @author mekong
 * @date 2024-06-03
 */
@Service
public class CGoodsManagementServiceImpl implements ICGoodsManagementService {
    @Resource
    private CGoodsManagementMapper cGoodsManagementMapper;

    /**
     * 查询商品管理
     *
     * @param id 商品管理主键
     * @return 商品管理
     */
    @Override
    public CGoodsManagement selectCGoodsManagementById(Long id) {
        return cGoodsManagementMapper.selectCGoodsManagementById(id);
    }

    /**
     * 查询商品管理列表
     *
     * @param cGoodsManagement 商品管理
     * @return 商品管理
     */
    @Override
    public List<CGoodsManagement> selectCGoodsManagementList(CGoodsManagement cGoodsManagement) {
        return cGoodsManagementMapper.selectCGoodsManagementList(cGoodsManagement);
    }

    /**
     * 新增商品管理
     *
     * @param cGoodsManagement 商品管理
     * @return 结果
     */
    @Override
    public int insertCGoodsManagement(CGoodsManagement cGoodsManagement) {
        return cGoodsManagementMapper.insertCGoodsManagement(cGoodsManagement);
    }

    /**
     * 修改商品管理
     *
     * @param cGoodsManagement 商品管理
     * @return 结果
     */
    @Override
    public int updateCGoodsManagement(CGoodsManagement cGoodsManagement) {
        return cGoodsManagementMapper.updateCGoodsManagement(cGoodsManagement);
    }

    /**
     * 批量删除商品管理
     *
     * @param ids 需要删除的商品管理主键
     * @return 结果
     */
    @Override
    public int deleteCGoodsManagementByIds(Long[] ids) {
        return cGoodsManagementMapper.deleteCGoodsManagementByIds(ids);
    }

    /**
     * 删除商品管理信息
     *
     * @param id 商品管理主键
     * @return 结果
     */
    @Override
    public int deleteCGoodsManagementById(Long id) {
        return cGoodsManagementMapper.deleteCGoodsManagementById(id);
    }
}
